
// /课程接口
import request from '@/static/uitls/request.js'

//评论页面
const commentRead = (course_order_id) => {
	return request({
		url: '/api/v1/course_comment/read?course_order_id='+course_order_id,
		method: 'GET'
	})
}
//发布评论
const createComment = (data) => {
	return request({
		url: '/api/v1/course_comment/create',
		method: 'POST',
		data
	})
}
//课程记录

const courseLog = (data) => {
	return request({
		url: '/api/v1/user.course/log',
		method: 'GET',
		data
	})
}

//课程详情
const courseRead = (id) => {
	return request({
		url: '/api/v1/course/read?course_id='+id,
		method: 'GET'
	})
}


//完成课表
const viewCourseFinish = (course_id) => {
	return request({
		url: '/api/v1/course/finish?course_id='+course_id,
		method: 'GET'
	})
}

//课程全部进度（订单页面）
const courseDegree = (id) => {
	return request({
		url: '/api/v1/user.course/degree?course_order_id='+id,
		method: 'GET'
	})
}
//课程完成进度（订单页面）
const courseFinish = (id) => {
	return request({
		url: '/api/v1/user.course/finish?course_order_id='+id,
		method: 'GET'
	})
}


//课程预约进度(单次课程列表页面)
const courseReserve = (id) => {
	return request({
		url: '/api/v1/user.course/reserve?course_order_id='+id,
		method: 'GET'
	})
}


//预约课表
const courseReservation = (data) => {
	return request({
		url: '/api/v1/course/reservation',
		method: 'POST',
		data
	})
}


module.exports = {
	commentRead,
	createComment,
	courseLog,
	courseRead,
	courseDegree,
	courseFinish,
	courseReserve,
	viewCourseFinish,
	courseReservation
}